/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package reportcenter.support.custom.exception;

import org.springframework.context.ApplicationEvent;

/**
 *
 * @author renan
 */
public class ApplicationAlertEvent extends ApplicationEvent {
	private static final long serialVersionUID = -1138298727688850377L;
	private String message;
	private EventType eventType;
	
	public ApplicationAlertEvent(EventType eventType, String message, Object source){
		super(source);
		this.message = message;
		this.eventType = eventType;
	}
	
	public String getMessage(){
		return message;
	}
	
	public boolean isErrorEvent(){
		return eventType == EventType.ERROR;
	}

	public boolean isWarningEvent(){
		return eventType == EventType.WARNING;
	}

	public boolean isInfoEvent(){
		return eventType == EventType.INFO;
	}
	
	public enum EventType{
		INFO,
		WARNING,
		ERROR;
	}
}

